<?
require_once("Clases/Docente.php");
session_start();
if (isset ($_SESSION["usuario"])){ 
    $docente = unserialize($_SESSION['usuario']);
    switch($docente->Tipo){
            case 0:
                header( 'Location: inicioProfesor.php' );
                break;
            case 1:
                header( 'Location: inicioTutor.php' );
                break;
            case 2:
                header( 'Location: inicioDirector.php' );
                break;
        }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>SRP | Sistema Reportes Preparatoria</title>
    <link href="font/stylesheet.css" rel="stylesheet" type="text/css" media="all" />
    <script src="js/jquery.uniform.js" type="text/javascript" charset="utf-8"></script>
    <!-- Include this jQuery library in your HTML somewhere: -->
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
    <!-- jQuery -->
    <script type="text/javascript" charset="utf-8">
      $(function(){
        $("input").uniform();
		$('.sign').click(function(){
			$('.message').fadeIn();
		})
		$('.message').click(function(){
			$('.message').fadeOut();
		})
      });
      
      function validaChrome()
      {
           var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
            if(!is_chrome)
            {
                var oDiv = document.getElementById("btnSubmit");
                oDiv.style.visibility = "hidden";
                alert("ERROR: Este Sistema Esta Desarrollado para Trabajar en Chrome, Debe Cambiar su Navegador a Chrome");
            }

      }
      
      function validar()
      {
       
        var user = document.getElementById('usuario').value;
        var pass = document.getElementById('password').value;
        var path= "Controladores/ValidaUsuario.php?usuario="+user+"&password="+pass;
        $.ajax({
            'url' : path,'type' : 'GET',
            'success' : function(data) {
                 if ((data == "1")) 
                    window.location.href = "Controladores/CrearPerfil.php?usuario="+user;
                 else
                     $(".text").html("<p> <font size=5> Datos Incorrectos</font> </p>");
               
            }
        });
        }
    </script>
    <link rel="stylesheet" href="css/uniform.default.css" type="text/css" media="screen" />
    <link href="css/styles.css" rel="stylesheet" type="text/css" media="all" />
    </head>

    <body>

<div id="login">
      <div id="log-Sup">
    <div id="logWrap">
          <h1>SRP<br />
        <span>Sistema Reportes Preparatoria</span></h1>
          <div id="LogPannel">
        <h2>Acceso</h2>
        <form>
              <input id="usuario" name="usuario" type="text" value="Username" onfocus="if(this.value=='Username')this.value=''" onblur="if(this.value=='')this.value='Username'" />
              <input id="password" name="password" type="password" value="password" onfocus="if(this.value=='password')this.value=''" onblur="if(this.value=='')this.value='password'" />
              <input name="submit" id="btnSubmit" class="blueButton" type="button" onclick="validar();" value="LOGIN" />
                <div class="text">
             
              </div>
         </form>
      </div>
       
        </div>
  </div>
   

      <div class="push"></div>
      
    </div>
<div id="foot">
      <p>© SRP</p>
    </div>
        <script>
            validaChrome();

            </script>
</body>
</html>
